

typedef struct tyn_binary_heap_t {
  size_t size;
  size_t max_size;
  void **nodes;
  int (*cmp)(const void *a, const void *b);
} tyn_binary_heap_t;

int tyn_binary_heap_heapify(tyn_binary_heap_t *, size_t);
tyn_binary_heap_t* tyn_binary_heap_create(size_t, int (*cmp)(void *a, void *b));
int tyn_binary_heap_insert(tyn_binary_heap_t *, void *);
void* tyn_binary_heap_extract_max(tyn_binary_heap_t *);
int tyn_binary_heap_delete(tyn_binary_heap_t *, size_t);
int tyn_binary_heap_destroy(tyn_binary_heap_t *);
